/*
 * JSF Toolkit Component Framework
 * Copyright (C) 2007 Noah Sloan <iamnoah A-T gmail D0T com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 */
package com.jsftoolkit.gen.writer;

import java.util.LinkedHashMap;
import java.util.Set;

/**
 * Utility base class for implementations of sub interfaces of
 * {@link ClassWriter}. By extending this class, the sub-interface
 * implementations are not coupled to a particular {@link ClassWriter}
 * implementation.
 * <p>
 * All methods pass through to the wrapped {@link ClassWriter}.
 */
public abstract class ClassWriterWrapper implements ClassWriter {
	private ClassWriter writer;

	public void close() {
		writer.close();
	}

	public void endBlock() {
		writer.endBlock();
	}

	public ClassWriter indent() {
		return writer.indent();
	}

	public ClassWriter print(char c) {
		return writer.print(c);
	}

	public ClassWriter print(CharSequence s) {
		return writer.print(s);
	}

	public void printClassComment() {
		writer.printClassComment();
	}

	public void printConstant(Class<?> type, String name, CharSequence value) {
		writer.printConstant(type, name, value);
	}

	public void printDeclaration(int mods, String className, Class<?> superClass,
			Iterable<Class<?>> interfaces) {
		writer.printDeclaration(mods, className, superClass, interfaces);
	}

	public void printImports(Set<Class<?>> imports) {
		writer.printImports(imports);
	}

	public void printModifiers(int mod) {
		writer.printModifiers(mod);
	}

	public void printPackage(String _package) {
		writer.printPackage(_package);
	}

	public void printType(Class<?> c) {
		writer.printType(c);
	}

	public ClassWriter printf(String format, Object... args) {
		return writer.printf(format, args);
	}

	public ClassWriter println(CharSequence s) {
		return writer.println(s);
	}

	public void startBlock() {
		writer.startBlock();
	}

	public void startConstructor(int mods, LinkedHashMap<String, Class<?>> params,
			Class<? extends Throwable>... exceptions) {
		writer.startConstructor(mods, params, exceptions);
	}

	public void startField(int mods, Class<?> type, String name) {
		writer.startField(mods, type, name);
	}

	public void startMethod(int mods, Class<?> returnType, String name,
			LinkedHashMap<String, Class<?>> params,
			Class<? extends Throwable>... exceptions) {
		writer.startMethod(mods, returnType, name, params, exceptions);
	}

	public void printPropertyAccessors(String propertyName,
			Class<?> propertyClass) {
		writer.printPropertyAccessors(propertyName, propertyClass);
	}

	public String getFieldName(String name) {
		return writer.getFieldName(name);
	}

	public ClassWriter getWriter() {
		return writer;
	}

	public void setWriter(ClassWriter writer) {
		this.writer = writer;
	}

	public void printFileComment() {
		writer.printFileComment();
	}

}
